function addFriendButton() {
    var id = $("#userId").val();
    var param = {
        id:id
    };
    $.ajax({
        url: '/user/addfriend',
        type:"POST",
        dataType: "json",
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify(param),
        success: function (res) {
            console.log(res.success);
            if (res.success) {
                // alert("登录失败");
                alert("消息已发送，请耐心等待");
            }else {
                $('.errorMessage').html(res.message)
            }
        }
    });
}